package com.foxzzz.temporary;


public class Solution1323 {
    public int maximum69Number(int num) {
        String s = "" + num;
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if ('6' == chars[i]) {
                chars[i] = '9';
                break;
            }
        }
        return Integer.parseInt(new String(chars));
    }

    public static void main(String[] args) {
        System.out.println(new Solution1323().maximum69Number(9669));
        System.out.println(new Solution1323().maximum69Number(9996));
        System.out.println(new Solution1323().maximum69Number(9999));
    }
}
